class TextRecordResponse {
  final int code;
  final String msg;
  final List<TextRecord> data;

  TextRecordResponse({
    required this.code,
    required this.msg,
    required this.data,
  });

  factory TextRecordResponse.fromJson(Map<String, dynamic> json) {
    return TextRecordResponse(
      code: json['code'],
      msg: json['msg'],
      data: (json['data'] as List<dynamic>).map((textRecord)=>TextRecord.fromJson(textRecord as Map<String, dynamic>)).toList(),
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'code': code,
      'msg': msg,
      'data': data.map((textRecord) => textRecord.toJson()).toList(),
    };
  }
}

class TextRecord {
  String title;
  String createdDate;
  int id;

  TextRecord({
    required this.title,
    required this.createdDate,
    required this.id,
  });

  factory TextRecord.fromJson(Map<String, dynamic> json) {
    return TextRecord(
      title: json['title'],
      createdDate: json['createdDate']??"",
      id: json['id'],
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'title': title,
      'createdDate': createdDate,
      'id': id,
    };
  }

  static init() {
    return TextRecord(title: "", createdDate: "", id: 0,);
  }
}